package com.lin.manager.sms.enums;

import java.util.Objects;

/**
 * @author linjiang
 * @date 2024/8/19
 * @fn
 */
public enum PlatformEnum {
    LOCAL("local"),
    ALIYUN("aliyun"),
    TENCENT("tencent");

    private String code;

    PlatformEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static PlatformEnum get(String code) {
        for (PlatformEnum platformEnum : PlatformEnum.values()) {
            if (Objects.nonNull(code) && platformEnum.getCode().equals(code)) {
                return platformEnum;
            }
        }
        return null;
    }
}
